import axios from 'axios';

//根据租户id查询所有模版
export function doPost(param) {
    return axios({
        method: 'post',
        url: '/print/doPost',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//新建模版
export function design(param) {
    return axios({
        method: 'get',
        url: '/print/design',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//根据业务对象获取模版编码
export function getPrintCode(param) {
    return axios({
        method: 'get',
        url: '/bo/getPrintCode',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//初始化业务对象
export function init(param) {
    return axios({
        method: 'post',
        url: '/bo/init',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}


//模版预览
export function preview(param) {
    return axios({
        method: 'get',
        url: '/print/preview',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}


//模版预览
export function getDatasource(param) {
    return axios({
        method: 'get',
        url: '/print/doGet',
        params: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}

//同步模板
export function doSyncTemplate(param) {
    return axios({
        method: 'post',
        url: '/bo/initTenantBizz',
        data: param,
        headers: {
            'Cache-Control': 'no-cache'
        }
    })
}